home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group99a.txt / 000073_icon-group-sender _Wed Mar 31 09:26:55 1999.msg < prev    next >
Internet Message Format  |  2000-09-20  |  2KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA09376
  4.     for icon-group-addresses; Wed, 31 Mar 1999 09:26:48 -0700 (MST)
  5. Message-Id: <199903311626.JAA09376@baskerville.CS.Arizona.EDU>
  6. Date: Tue, 30 Mar 1999 22:47:27 -0500
  7. From: Phillip Lee Thomas <teruthom@ix.netcom.com>
  8. X-Accept-Language: en
  9. To: Steve Graham <graham@cowboy.biomed.com>, icon-group@optima.CS.Arizona.EDU
  10. Subject: Re: Problem reading binary file
  11. Errors-To: icon-group-errors@optima.CS.Arizona.EDU
  12. Status: RO
  13.  
  14. Steve,
  15.  
  16. Under DOS, the files need to be opened in "untranslated" mode:
  17.  
  18.  
  19.   in  := open(args[1],"ru") | stop("Unable to open ",args[1])
  20.   out := open(args[2],"wu") | stop("Unable to open ",args[2])
  21.  
  22. This stops the translation of <CR><LF> and other characters with special
  23. meaning in DOS.
  24.  
  25. Phillip
  26.  
  27. Steve Graham wrote:
  28.  
  29. > Hello.
  30. >
  31. > I am using MS-DOS Icon 9.1 to read a binary file.  After reading 6
  32. > characters, the program apparently quits reading.  I have attached the
  33. > relevant portion of the code:
  34. >
  35. > -------------------------- Code ------------------------------
  36. > procedure main(args)
  37. > #
  38. >   cnt := 0
  39. >   in  := open(args[1],"r") | stop("Unable to open ",args[1])
  40. >   out := open(args[2],"w") | stop("Unable to open ",args[2])
  41. >   while character := reads(in,1) do {
  42. >      write(character," -->", ord(character))
  43. >      cnt := cnt+1
  44. >     }
  45. >   close(in,out)
  46. >   write(cnt," characters transferred")
  47. > end
  48. > -----------------------End of Code-------------------------
  49. >
  50. > I invoke the program with:
  51. >
  52. > word r99-0059.doc r99-0059.txt
  53. >
  54. > I get output of (some unprintable characters are represent by _):
  55. >
  56. > - -->208
  57. > - -->207
  58. >  -->17
  59. > _ -->224
  60. > ∩┐╜ -->161
  61. > _ -->177
  62. > 6 characters transferred
  63. >
  64. > Any ideas?
  65. >
  66. > Thanks in advance.
  67. >
  68. > -- Steve
  69. >
  70. > ______________________________________________________
  71. >
  72. > Steve Graham
  73. > Laboratory Corporation of America (LabCorp)
  74. > 12160 Abrams Road, Suite 601
  75. > Dallas, Texas 75243
  76. >
  77. > E-mail: graham@cowboy.biomed.com
  78. > Phone:  972.643.6124  (direct to desk)
  79. >         972.437.5255 ext 5224
  80. > FAX:    972.454.1040
  81. > _______________________________________________________
  82.  
  83.